<?php


class important extends connector {

	function important() {
		$this->softbase(true);
	}

	function onformlist() {
		$this->powercheck(165, 166);
		parent::start_template();

		$MinPageid = $this->fun->accept('MinPageid', 'R');

		$page_id = $this->fun->accept('page_id', 'R');

		$countnum = $this->fun->accept('countnum', 'R');

		$MaxPerPage = $this->fun->accept('MaxPerPage', 'R');
		if (empty($MaxPerPage)) {
			$MaxPerPage = $this->CON['max_list'];
		}
		$wheretext = null;
		$isclass = $this->fun->accept('isclass', 'R');
		if (!empty($isclass)) {
			if ($isclass == 2) $isclass = 0;
			$wheretext.=' AND isclass=' . $isclass;
		}
		$ismenu = $this->fun->accept('ismenu', 'R');
		if (!empty($ismenu)) {
			if ($ismenu == 2) $ismenu = 0;
			$wheretext.=' AND ismenu=' . $ismenu;
		}
		$isseccode = $this->fun->accept('isseccode', 'R');
		if (!empty($isseccode)) {
			if ($isseccode == 2) $isseccode = 0;
			$wheretext.=' AND isseccode=' . $isseccode;
		}
		$iscount = $this->fun->accept('iscount', 'R');
		if (!empty($iscount)) {
			if ($iscount == 2) $iscount = 0;
			$wheretext.=' AND iscount=' . $iscount;
		}
		$isinputtime = $this->fun->accept('isinputtime', 'R');
		if (!empty($isinputtime)) {
			if ($isinputtime == 2) $isinputtime = 0;
			$wheretext.=' AND isinputtime=' . $isinputtime;
		}
		$ismail = $this->fun->accept('ismail', 'R');
		if (!empty($ismail)) {
			if ($ismail == 2) $ismail = 0;
			$wheretext.=' AND ismail=' . $ismail;
		}
		$lng = $this->fun->accept('lng', 'R');
		if (!empty($lng)) {
			$wheretext.=' AND lng=\'' . $lng . '\'';
		}


		$limitkey = $this->fun->accept('limitkey', 'R');
		$limitkey = empty($limitkey) ? 'fgid' : $limitkey;

		$limitclass = $this->fun->accept('limitclass', 'R');
		$limitclass = empty($limitclass) ? 'DESC' : $limitclass;
		$db_where = " WHERE fgid>0" . $wheretext;
		$db_table = db_prefix . 'form_group';
		if (!empty($countnum)) {
			$countnum = $this->db_numrows($db_table, $db_where);
			exit($countnum);
		}
		$sql = 'SELECT fgid,pid,lng,formgroupname,formcode,countattrs,template,emailatt,addtime,isclass,ismenu,isseccode,ismail,tmid,isinputtime,inputtime,purview,iscount FROM ' . $db_table . $db_where . ' ORDER BY ' . $limitkey . ' ' . $limitclass . ' LIMIT ' . $MinPageid . ',' . $MaxPerPage;
		$rs = $this->db->query($sql);
		while ($rsList = $this->db->fetch_assoc($rs)) {
			$array[] = $rsList;
		}
		$this->fun->setcookie($this->fun->noncefile() . 'pgid', $page_id, 600);
		$this->ectemplates->assign('array', $array);
		$this->ectemplates->assign('sql', $sql);
		$this->ectemplates->display('form/form_list');
	}

	function onlist() {
		include_once admin_ROOT . adminfile . '/include/command_list.php';
		parent::start_template();
		$listfunction = $this->fun->accept('listfunction', 'G');
		if (empty($listfunction)) {
			exit('err');
		}
		$fgid = $this->fun->accept('fgid', 'R');

		$cookpage = $this->fun->accept($CONLIST[$listfunction]['pagecoock'], 'C');
		$nowpage = empty($cookpage) ? 0 : $cookpage;
		$this->ectemplates->assign('nowpage', $nowpage);
		$this->ectemplates->assign('loadurl', $CONLIST[$listfunction]['loadurl'] . '&fgid=' . $fgid);

		$this->ectemplates->assign('MaxPerPage', $this->CON['max_list']);

		$this->ectemplates->assign('MaxHit', $this->CON['max_page']);
		$this->ectemplates->assign('listtype', $listtype);
		$this->ectemplates->assign('listfunction', $listfunction);
		$this->ectemplates->display('form/form_tab_list');
	}

	function onformattlist() {
		parent::start_template();

		$MinPageid = $this->fun->accept('MinPageid', 'R');

		$page_id = $this->fun->accept('page_id', 'R');

		$countnum = $this->fun->accept('countnum', 'R');

		$MaxPerPage = $this->fun->accept('MaxPerPage', 'R');
		if (empty($MaxPerPage)) {
			$MaxPerPage = $this->CON['max_list'];
		}
		$wheretext = null;
		$isclass = $this->fun->accept('isclass', 'R');
		if (!empty($isclass)) {
			if ($isclass == 2) $isclass = 0;
			$wheretext.=' AND isclass=' . $isclass;
		}
		$isvalidate = $this->fun->accept('isvalidate', 'R');
		if (!empty($isvalidate)) {
			if ($isvalidate == 2) $isvalidate = 0;
			$wheretext.=' AND isvalidate=' . $isvalidate;
		}
		$isline = $this->fun->accept('isline', 'R');
		if (!empty($isline)) {
			if ($isline == 2) $isline = 0;
			$wheretext.=' AND isline=' . $isline;
		}
		$iscount = $this->fun->accept('iscount', 'R');
		if (!empty($iscount)) {
			if ($iscount == 2) $iscount = 0;
			$wheretext.=' AND iscount=' . $iscount;
		}
		$fgid = $this->fun->accept('fgid', 'R');


		$limitkey = $this->fun->accept('limitkey', 'R');
		$limitkey = empty($limitkey) ? 'faid' : $limitkey;

		$limitclass = $this->fun->accept('limitclass', 'R');
		$limitclass = empty($limitclass) ? 'DESC' : $limitclass;
		$db_where = " WHERE fgid=$fgid" . $wheretext;
		$db_table = db_prefix . 'form_attr';
		if (!empty($countnum)) {
			$countnum = $this->db_numrows($db_table, $db_where);
			exit($countnum);
		}
		$sql = 'SELECT faid,fgid,pid,typename,attrname,inputtype,attrvalue,validatetext,attrcue,attrsize,attrrow,attrlenther,isclass,iscount,isvalidate,isline FROM ' . $db_table . $db_where . '
			ORDER BY ' . $limitkey . ' ' . $limitclass . ' LIMIT ' . $MinPageid . ',' . $MaxPerPage;
		$rs = $this->db->query($sql);
		while ($rsList = $this->db->fetch_assoc($rs)) {
			$array[] = $rsList;
		}
		$this->fun->setcookie($this->fun->noncefile() . 'pgid', $page_id, 600);
		$this->ectemplates->assign('array', $array);
		$this->ectemplates->assign('sql', $sql);
		$this->ectemplates->display('form/form_att_list');
	}

	function onformpreview() {
		parent::start_template();
		$db_table = db_prefix . 'form_group';
		$fgid = $this->fun->accept('fgid', 'G');
		$db_where = 'fgid=' . $fgid;
		$formread = $this->db->fetch_first('SELECT * FROM ' . $db_table . ' WHERE ' . $db_where);

		$db_where = ' WHERE isclass=1 and fgid=' . $fgid . ' ORDER BY pid,faid desc';
		$db_table = db_prefix . 'form_attr';
		$sql = 'SELECT * FROM ' . $db_table . $db_where;
		$rs = $this->db->query($sql);
		while ($rsList = $this->db->fetch_assoc($rs)) {
			if ($rsList['inputtype'] == 'select' || $rsList['inputtype'] == 'radio' || $rsList['inputtype'] == 'checkbox') {
				$forvalue = split("\n", $rsList['attrvalue']);
				$newvalue = array();
				foreach ($forvalue as $key => $forvalue) {
					if ($key == 0) {
						$newvalue[] = array('name' => $forvalue, 'selected' => 'selected');
					} else {
						$newvalue[] = array('name' => $forvalue, 'selected' => '');
					}
				}
				$rsList['attrvalue'] = $newvalue;
			}
			$attrread[] = $rsList;
		}
		$this->ectemplates->assign('read', $formread);
		$this->ectemplates->assign('attrread', $attrread);
		$this->ectemplates->display('form/form_preview');
	}

	function onformadd() {
		$this->powercheck(165, 167);
		parent::start_template();
		$tab = $this->fun->accept('tab', 'G');
		$tab = empty($tab) ? 'true' : $tab;
		$lng = $this->get_lng_array($this->CON['default_lng']);

		$memberpuv = $this->get_member_purview_array();
		$this->ectemplates->assign('memberpuvlist', $memberpuv['list']);

		$this->ectemplates->assign('tab', $tab);
		$this->ectemplates->assign('lng', $lng['list']);
		$this->ectemplates->display('form/form_add');
	}

	function onformedit() {
		$this->powercheck(165, 171);
		parent::start_template();
		$db_table = db_prefix . 'form_group';
		$type = $this->fun->accept('type', 'G');
		$id = $this->fun->accept('id', 'G');
		$db_where = 'fgid=' . $id;
		$formread = $this->db->fetch_first('SELECT * FROM ' . $db_table . ' WHERE ' . $db_where);

		$memberpuv = $this->get_member_purview_array($formread['purview']);
		$this->ectemplates->assign('memberpuvlist', $memberpuv['list']);
		$this->ectemplates->assign('tab', 'true');
		$this->ectemplates->assign('formread', $formread);
		if ($type == 'copy') {
			$lng = $this->get_lng_array($formread['lng']);
			$this->ectemplates->assign('lng', $lng['list']);
			$this->ectemplates->display('form/form_copy');
		} else {
			$this->ectemplates->assign('type', $type);
			$this->ectemplates->display('form/form_edit');
		}
	}

	function onformattradd() {
		$this->powercheck(165, 174);
		include_once admin_ROOT . adminfile . '/include/inc_formtypelist.php';
		parent::start_template();
		$fgid = $this->fun->accept('fgid', 'G');
		$this->ectemplates->assign('fgid', $fgid);
		$this->ectemplates->assign('tab', 'true');
		$this->ectemplates->assign('formtypelist', $FORMTYPE);
		$this->ectemplates->display('form/form_att_add');
	}

	function onformattredit() {
		$this->powercheck(165, 175);
		include_once admin_ROOT . adminfile . '/include/inc_formtypelist.php';
		parent::start_template();
		$db_table = db_prefix . 'form_attr';
		$faid = $this->fun->accept('faid', 'G');
		$db_where = 'faid=' . $faid;
		$formattrread = $this->db->fetch_first('SELECT * FROM ' . $db_table . ' WHERE ' . $db_where);
		$this->ectemplates->assign('tab', 'true');
		$this->ectemplates->assign('formtypelist', $FORMTYPE);
		$this->ectemplates->assign('attrread', $formattrread);
		$this->ectemplates->display('form/form_att_edit');
	}

	function onformsave() {
		parent::start_template();
		$inputclass = $this->fun->accept('inputclass', 'P');
		$lng = $this->fun->accept('lng', 'P');
		$formgroupname = $this->fun->accept('formgroupname', 'P');
		$formcode = $this->fun->accept('formcode', 'P');
		$purview = $this->fun->accept('purview', 'P');
		$content = $this->fun->accept('content', 'P');
		$countattrs = $this->fun->accept('countattrs', 'P');
		$template = $this->fun->accept('template', 'P');
		$emailatt = $this->fun->accept('emailatt', 'P');
		$ismail = $this->fun->accept('ismail', 'P');
		$successtext = $this->fun->accept('successtext', 'P');
		$ismenu = $this->fun->accept('ismenu', 'P');
		$isseccode = $this->fun->accept('isseccode', 'P');
		$iscount = $this->fun->accept('iscount', 'P');
		$isinputtime = $this->fun->accept('isinputtime', 'P');
		$inputtime = $this->fun->accept('inputtime', 'P');
		$tmid = $this->fun->accept('tmid', 'P');
		$tmid = empty($tmid) ? 0 : intval($tmid);
		$db_table = db_prefix . 'form_group';
		$date = time();
		if ($inputclass == 'add') {
			$this->powercheck(165, 167);
			$isclass = $this->esp_inputclassid;
			$isclass = empty($isclass) ? 0 : $isclass;
			$db_field = 'pid,lng,formgroupname,formcode,content,successtext,countattrs,template,emailatt,addtime,isclass,ismenu,isseccode,ismail,tmid,isinputtime,inputtime,purview,iscount';
			$db_values = "50,'$lng','$formgroupname','$formcode','$content','$successtext','$countattrs','$template','$emailatt',$date,$isclass,$ismenu,$isseccode,$ismail,$tmid,$isinputtime,$inputtime,$purview,$iscount";
			$this->db->query('INSERT INTO ' . $db_table . ' (' . $db_field . ') VALUES (' . $db_values . ')');
			$this->writelog($this->lng['formmain_add_log'], $this->lng['log_extra_ok'] . ' formgroupname=' . $formgroupname);
			$this->dbcache->clearcache('formgroup_array_' . $lng, true);
			exit('true');
		} elseif ($inputclass == 'edit') {
			$this->powercheck(165, 171);
			$fgid = $this->fun->accept('fgid', 'P');
			if (empty($fgid)) exit('false');
			$db_where = 'fgid=' . $fgid;
			$db_set = "formgroupname='$formgroupname',content='$content',successtext='$successtext',countattrs='$countattrs',template='$template',emailatt='$emailatt',ismenu=$ismenu,isseccode=$isseccode,ismail=$ismail,tmid=$tmid,isinputtime=$isinputtime,inputtime=$inputtime,purview=$purview,iscount=$iscount";
			$this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where);
			$this->writelog($this->lng['formmain_edit_log'], $this->lng['log_extra_ok'] . ' formgroupname=' . $formgroupname . ' id=' . $fgid);
			$this->dbcache->clearcache('formgroup_view_' . $id, true);
			$this->dbcache->clearcache('formgroup_array_' . $lng, true);
			exit('true');
		} elseif ($inputclass == 'copy') {
			$this->powercheck(165, 173);
			$fgid = $this->fun->accept('fgid', 'P');
			if (empty($fgid)) exit('false');
			$isclass = $this->esp_inputclassid;
			$isclass = empty($isclass) ? 0 : $isclass;

			$db_field = 'pid,lng,formgroupname,formcode,content,successtext,countattrs,template,emailatt,addtime,isclass,ismenu,isseccode,ismail,tmid,isinputtime,inputtime,purview,iscount';
			$db_values = "50,'$lng','$formgroupname','$formcode','$content','$successtext','$countattrs','$template','$emailatt',$date,$isclass,$ismenu,$isseccode,$ismail,$tmid,$isinputtime,$inputtime,$purview,$iscount";
			$this->db->query('INSERT INTO ' . $db_table . ' (' . $db_field . ') VALUES (' . $db_values . ')');
			$installid = $this->db->insert_id();
			if (empty($installid)) exit('false');

			$db_where = " WHERE fgid=$fgid";
			$db_table = db_prefix . 'form_attr';
			$sql = 'SELECT * FROM ' . $db_table . $db_where;
			$rs = $this->db->query($sql);
			$installstr = "INSERT INTO $db_table (fgid,pid,typename,attrname,inputtype,attrvalue,validatetext,attrcue,attrsize,attrrow,attrlenther,isclass,iscount,isvalidate,isline) VALUES";
			$i = 0;
			while ($rsList = $this->db->fetch_assoc($rs)) {
				$i++;
				$installstr.="($installid,$rsList[pid],'$rsList[typename]','$rsList[attrname]','$rsList[inputtype]','$rsList[attrvalue]','$rsList[validatetext]',
				'$rsList[attrcue]',$rsList[attrsize],$rsList[attrrow],$rsList[attrlenther],$rsList[isclass],$rsList[iscount],$rsList[isvalidate],$rsList[isline]),";
			}
			if ($i > 0) {

				$newinstall = substr($installstr, 0, strlen($installstr) - 1);
				$this->db->query($newinstall);
			}
			$this->writelog($this->lng['formmain_copy_log'], $this->lng['log_extra_ok'] . ' formgroupname=' . $formgroupname . ' id=' . $fgid);
			$this->dbcache->clearcache('formgroup_array_' . $lng, true);
			exit('true');
		}
	}

	function onformattrsave() {
		parent::start_template();
		$inputclass = $this->fun->accept('inputclass', 'P');
		$fgid = $this->fun->accept('fgid', 'P');
		$typename = $this->fun->accept('typename', 'P');
		$attrname = $this->fun->accept('attrname', 'P');
		$attrcue = $this->fun->accept('attrcue', 'P');
		$inputtype = $this->fun->accept('inputtype', 'P');
		$attrvalue = $this->fun->accept('attrvalue', 'P');
		$attrsize = $this->fun->accept('attrsize', 'P');
		$attrsize = empty($attrsize) ? 20 : $attrsize;
		$attrrow = $this->fun->accept('attrrow', 'P');
		$attrrow = empty($attrrow) ? 5 : $attrrow;
		$attrlenther = $this->fun->accept('attrlenther', 'P');
		$attrlenther = empty($attrlenther) ? 50 : $attrlenther;
		$validatetext = $this->fun->accept('validatetext', 'P');
		$isvalidate = $this->fun->accept('isvalidate', 'P');
		$isline = $this->fun->accept('isline', 'P');
		$iscount = $this->fun->accept('iscount', 'P');
		$db_table = db_prefix . 'form_attr';
		if ($inputclass == 'add') {
			$this->powercheck(165, 174);
			$db_field = 'fgid,pid,typename,attrname,inputtype,attrvalue,validatetext,attrcue,attrsize,attrrow,attrlenther,isclass,iscount,isvalidate,isline';
			$db_values = "$fgid,50,'$typename','$attrname','$inputtype','$attrvalue','$validatetext','$attrcue',$attrsize,$attrrow,$attrlenther,1,$iscount,$isvalidate,$isline";
			$this->db->query('INSERT INTO ' . $db_table . ' (' . $db_field . ') VALUES (' . $db_values . ')');
			$this->writelog($this->lng['formmain_attr_add_log'], $this->lng['log_extra_ok'] . ' typename=' . $typename);
			$this->dbcache->clearcache('formatt_array_' . $fgid, true);
			exit('true');
		} elseif ($inputclass == 'edit') {
			$this->powercheck(165, 175);
			$faid = $this->fun->accept('faid', 'P');
			$db_where = 'faid=' . $faid;
			$db_set = "typename='$typename',attrcue='$attrcue',validatetext='$validatetext',inputtype='$inputtype',attrvalue='$attrvalue',attrsize=$attrsize,attrrow=$attrrow,attrlenther=$attrlenther,isvalidate=$isvalidate,iscount=$iscount,isline=$isline";
			$this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where);
			$this->writelog($this->lng['formmain_attr_edit_log'], $this->lng['log_extra_ok'] . ' typename=' . $typename . ' id=' . $faid);
			$this->dbcache->clearcache('formatt_array_' . $fgid, true);
			exit('true');
		}
	}

	function ondelform() {
		$this->powercheck(165, 172);
		$db_table = db_prefix . 'form_group';
		$db_table2 = db_prefix . 'form_attr';
		$id = $this->fun->accept('id', 'R');
		if (empty($id)) exit('false');
		$db_where = "fgid=$id";
		$this->db->query('DELETE FROM ' . $db_table . ' WHERE ' . $db_where);
		$this->db->query('DELETE FROM ' . $db_table2 . ' WHERE ' . $db_where);
		$this->writelog($this->lng['formmain_del_log'], $this->lng['log_extra_ok'] . ' id=' . $selectinfoid);
		$this->dbcache->clearcache('formgroup_array', true);
		$this->dbcache->clearcache('formgroup_view_' . $id, true);
		$this->dbcache->clearcache('formatt_array_' . $id, true);
		exit('true');
	}

	function ondelattr() {
		$this->powercheck(165, 176);
		$db_table = db_prefix . 'form_attr';
		$selectinfoid = $this->fun->accept('attrselectinfoid', 'P');
		if (empty($selectinfoid)) exit('false');
		$infoarray = explode(',', $selectinfoid);
		$count = count($infoarray) - 1;
		if ($count <= 0) exit('false');
		for ($i = 0; $i < $count; $i++) {
			$db_where = "faid=$infoarray[$i]";
			$this->db->query('DELETE FROM ' . $db_table . ' WHERE ' . $db_where);
		}
		$this->writelog($this->lng['formmain_attr_log_del'], $this->lng['log_extra_ok'] . ' id=' . $selectinfoid);
		$this->dbcache->clearcache('formatt_array', true);
		exit('true');
	}

	function onattrsort() {
		$this->powercheck(165, 177);
		$db_table = db_prefix . 'form_attr';
		$id = $this->fun->accept('infoid', 'P');
		$pid = $this->fun->accept('pid', 'P');
		$idArray = explode(',', $id);
		$pidArray = explode(',', $pid);
		foreach ($idArray as $key => $value) {
			if (!empty($value)) {
				$db_where = "faid=$value";
				$pid = intval($pidArray[$key]);
				$db_set = "pid=$pid";
				$this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where);
			}
		}
		$this->writelog($this->lng['formmain_attr_log_sort'], $this->lng['log_extra_ok']);
		$this->dbcache->clearcache('formatt_array', true);
		exit('true');
	}

	function onformsetting() {
		$this->powercheck(165, 170);
		$db_table = db_prefix . 'form_group';
		$selectinfoid = $this->fun->accept('selectinfoid', 'P');
		$selectinfoid = $selectinfoid . '0';
		if (empty($selectinfoid)) exit('false');
		$value = $this->fun->accept('value', 'P');
		$dbname = $this->fun->accept('dbname', 'P');
		$db_set = "$dbname=$value";
		$db_where = "fgid IN ( $selectinfoid )";
		$this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where);
		$this->writelog($this->lng['formmain_isclass_log'], $this->lng['log_extra_ok'] . ' id=' . $selectinfoid);
		$this->dbcache->clearcache('formgroup_', true);
		exit('true');
	}

	function onattrsetting() {
		$this->powercheck(165, 175);
		$db_table = db_prefix . 'form_attr';
		$selectinfoid = $this->fun->accept('attrselectinfoid', 'P');
		$selectinfoid = $selectinfoid . '0';
		if (empty($selectinfoid)) exit('false');
		$value = $this->fun->accept('value', 'P');
		$dbname = $this->fun->accept('dbname', 'P');
		$db_set = "$dbname=$value";
		$db_where = "faid IN ( $selectinfoid )";
		$this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where);
		$this->writelog($this->lng['formmain_attr_log_istype'], $this->lng['log_extra_ok'] . ' id=' . $selectinfoid);
		$this->dbcache->clearcache('formatt_array', true);
		exit('true');
	}

	function oncheckattrname() {
		$attlist = array('did', 'lng', 'pid', 'mid', 'aid', 'tid', 'sid', 'fgid', 'isclass', 'islink', 'ishtml', 'ismess', 'isorder',
		    'attrvalue', 'fvid', 'fgid', 'faid', 'ftid', 'did', 'iscount', 'oid', 'source', 'pic', 'tags', 'keywords',
		    'description', 'link', 'oprice', 'bprice', 'click', 'addtime', 'uptime', 'template', 'filename', 'filepath', 'daid', 'picname'
		    , 'picfile', 'addtime', 'dcid', 'content', 'dlid', 'mid', 'labelname', 'doid', 'startime', 'endtime', 'width', 'height',
		    'istime', 'filetype', 'dvid');
		$attrname = $this->fun->accept('attrname', 'R');
		$fgid = $this->fun->accept('fgid', 'R');
		$attrnamearray = strtolower($attrname);

		if (in_array($attrnamearray, $attlist)) {
			exit('false');
		}
		$db_table = db_prefix . 'form_attr';
		$db_where = " WHERE attrname='$attrname' and fgid=$fgid";
		$countnum = $this->db_numrows($db_table, $db_where);
		if ($countnum > 0) {
			$exportAjax = 'false';
		} else {
			$exportAjax = 'true';
		}
		exit($exportAjax);
	}

	function oncheckformname() {
		$attlist = array('did', 'lng', 'pid', 'mid', 'aid', 'tid', 'sid', 'fgid', 'isclass', 'islink', 'ishtml', 'ismess', 'isorder',
		    'attrvalue', 'fvid', 'fgid', 'faid', 'ftid', 'did', 'iscount', 'oid', 'source', 'pic', 'tags', 'keywords',
		    'description', 'link', 'oprice', 'bprice', 'click', 'addtime', 'uptime', 'template', 'filename', 'filepath', 'daid', 'picname'
		    , 'picfile', 'addtime', 'dcid', 'content', 'dlid', 'mid', 'labelname', 'doid', 'startime', 'endtime', 'width', 'height',
		    'istime', 'filetype', 'dvid');
		$formcode = $this->fun->accept('formcode', 'R');
		$attrnamearray = strtolower($formcode);

		if (in_array($attrnamearray, $attlist)) {
			exit('false');
		}
		$db_table = db_prefix . 'form_attr';
		$db_table2 = db_prefix . 'form_group';
		$db_where = " WHERE attrname='$formcode'";
		$db_where2 = " WHERE formcode='$formcode'";
		$countnum = $this->db_numrows($db_table, $db_where);
		if ($countnum > 0) {
			$exportAjax = 'false';
		} else {
			$countnum = $this->db_numrows($db_table, $db_where);
			if ($countnum > 0) {
				$exportAjax = 'false';
			} else {
				$exportAjax = 'true';
			}
		}
		exit($exportAjax);
	}

}
?>